Mark some functions const