Fixed some 'bugs'