bug fixes in fx.js