Fixed first-time startup errors, and some little mistakes