Preconditions fix and test