Add missing brackets, throw exception for illegal argument