added some consts

Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
@dachary, @stiopaa1 Returning mutable pointers, shouldn't be a const function (I really didn't think the language would let you do that, so very confused).