added more validity tests for inputs to hash.