Fixed some functionality