Minor fixes to work with cocoonJS