Fixed occasional errors on startup