Return 0 when no machines exist instead of throwing an error. This fixes the authentication error on fresh installations where the machines table is empty.