Some bug fixing and cleanup in minised