Fixing some errors and discretizing action.