Code tweaks
added trivial test case