in ma-apply before

loc=$(expr match "$line" '\(.*\):.*:.*:.*')

try to add the following line (watch the spaces)

line=$(echo "$line" | tr -cs 'a-zA-Z0-9\_\-\(\)\;\.\:\+\=\n\ \[\]' '+')