More small bug fixes and changes