Fixed an incorrect cast in preferences activity