Added test file, and minor modifications.