Fixed various bugs
Fixed various bugs