Added local storage and fixed some additional compatibility issues
Fixed local storage issue