Used Switches instead of IFs to prevent SQL injection and variable hijacking (had a danerous IF not empty - accepting all values).

Code ref: 5a7d0e2a102f86f21672dd148340d5f62dd0a0b6
Issue: #23, #22