fix some missing variables
fix a few more bugs left from method extraction