Merging code from dev-1.0