Fix minor bugs and rebuild