More minor bug fixes