Ticket #620: Fixing styling and logic mistakes