Added casting functions.