Fixed bug in address computation.
Code reformatted.