Fixed frame.js bugs