Remove throwing errors and make it consistent, small code cleanup
Improve test coverage