bug fix, added unit tests for gage