Corrected max to result.max in my inst controller. closes #640