Resolves issues #31, #15.