Implemented a more flexible blending system (fixes #298)