More bug fixes and a few new features