Cleaned up some code, added check for <3.2.3 versions, updated tests.