Changes for compatibility with older Pi