Fixing gcc "type qualifiers ignored on function return type" warnings