Fix for readonlyattributes when underscored is true. Closes #1523