fixed some bugs on the layout; corrected cross-origin problems in firefox.