Commit before spring cleaning with some bug fixes.