Final bug fixes and changes