general fixes to work with scripting