-Fixed various bugs