FIX: small logic errors in code