Various small bug fixes and updates