Minor bug fixes and formattings