Small syntax changes, unused functions removed.