small but critical fixes