Fix: invalid list of params
Fix: loading of sql menu
Fix several bugs reported by scrutinizer