Input validation fixes

Closes #117 
@westonruter