small fixes to invoice SQL, bills JS and remote sign in