Fix minification errors, inject dependencies