Fixed code style and added the test case which slipped the previous commit