Various (mostly minor) changes -- maybe code works now?