Some cleanup and first attempt to fix facebook login problem