Merged in changes from an0m13/master. Closes #4.