Fix short-circuit evaluation in if statement
Add some tests for CustomerProfile model