Style fixes.
Uses ternary conditional operator now in session_query().