specs/fixes for edge cases and invalid input