Fixed various issues
Fixed #2
Fixed #3