MEDIUM / Various bug fixes and improvments