Fixed preliminary bugs