Fix stackoverflow error

Return the map instead of a recursive call to getParameters()