Minor fixes, and move some global storages to storage table