Added unit tests for chabby's patch