Fixed #803 thanks to @ninjalulz

Fixed #803
Fixed #825
Fixed #1212
Fixed #1211