Throw exception instead of returning undefined on invalid parameter
Standardize test
Bump version to 0.3.1