ErrorDocument handling, minor syntax fixes