FIX: misc bugs.