Resolved issues #32 and #40