Only use localStorage if available. Fix style.