Bug fixes and TODO list