A few moere bug fixes