Lots of bug fixes and couple new features