Fix bugs; implement new features