Changes proposed by f0rk

relayed via mst in #magnet-srb and http://paste.scsys.co.uk/396085
My revisions to f0rk's changes