Fix shelve bugs