Fixes suggested by benogle