Fixed all sorts of problems