Fixes #37 and #33

Signed-off-by: Madhu Venugopal <madhu@socketplane.io>