Added fh:close() in ai.new to avoid locking the ai files on some operating systems.