Fix possible double-registration and element selector. Fixes #5