Fixed: Some bugs and error messages