fixes to work inside an engine (Version 0.1.6)