bug fixes, preparing peer api