added basic runtime test, fixed various issues with emit