added types for run and some small bugs in client