Potential fix for issues #16 and #24