Made minor bug fixes