Small bug fixes