upgrade to 1.7 & added test profile
code cleanup
fixed possible memory leak