Various small bug fixes and enhancements for the module