Bug Fix

Fixed a few bugs and added an onDisable() function.