Fixed issue in test.
Added backward compatibility functions.
Code conventions.
Added comments.
Code formatting.