Modified script to use access.log.0

Also fixed bugs.