Removed a few bugs