Fixed Issue #3 and Issue #14. Also fixed Issue #10 and #12

@andrewberls 

~requested: 700