Fixed more bugs and added more reference files