Bug fix for amd and minification compatibility