add tests for extensions and fix some little bugs