Fixed a couple of issues mentioned in github issue 13