Described automatic release/regaining locks (closes #24)

* and few other little type fixes

Wrote this in a bit of a hurry... hope it's ok!