Adaptations for APP Engine compatibility