Code fixes done by Efthymis