Fixed some problems