Fix errors and remove unneeded statics