Code style tweaks and increasing test coverage