small bug fixes and type up