Removed shitty, barely implemented scopeguard (I'll just use boost's ScopeExit or whatever.)