Fixed bug in precondition checks