Fix activity length validation