Code refactorization (<? replaced for <?php) and fixed a saving bug