Fixes from functional testing (need to automate this stuff!)