Bug fixes and enhancements

closes #51
closes #50
closes #49
closes #47
closes #46
closes #45
closes #43
closes #40