Improving extensions, error handling and tests