Removed useless line of code and added more tests

Removed useless variable setting leaveEmpty. Added more tests to show
proper behavior expectations.