Fixed bugs detected by closure compiler