Fixing the bugs and feature requests from Morino