Fixes suggested by fenryxo