Did some small bug fixes