Fixes

Updated old scripts. Some bug fixes.