Main function modified to get absolute path. Tested with Python 2.4 and 2.7