Bugs and cleanup