More bug fixes and functionality