Make getActiveFrame optional.
Reduce code duplication.
Merge pull request #116 from greboid/master

Make getActiveFrame optional.