Fix ipas bugs

Fixes #139

@wrycta's pull was good besides an extra `}` on 41 and `$reso` instead of `reso` on 36.
It's a good idea to run all of the changed code before a pull is made as that would have been caught then when the plugin didn't load.