Compatibility with sdk 1.4

Compiles with SDK version 1.4, but not fully tested yet.