Some bug fixes, cleaning up and formatting