Minor bug fixes and added functionality