Fixed issues with readonly mode