Revised unit tests and added fix for issue #18