Unused import
Improve precondition checks; test