[#5] Fixes for undefined global objects