Bug 673 fixes

https://gist.github.com/rgatkowski/0c06f687be748be46563