Made changes to fix more bugs