Bug fixes and startup checks