Added checking if the parameter is in range to increase compatibility with orginal ed