Frame script

Some bug fixes to get icycle further.