Major work and file fixes