Update: sort parameters, remove empty strings from array