Add ability to override flags

Tests included.