Corrected while-loop test and added 2 additional unit tests