First commit with bug fixes and feature additions