fixed bugs #15 and #16
tagged for 3.0.0