Small bug fixes that fixed a great deal of annoying thing.