Fixed bug in document system and updated tablet UI