Cleanup and fix of IE bug